<?php
/**
 * Created by PhpStorm.
 * User: kx520
 * Date: 2020-07-06
 * Time: 13:07
 */

namespace app\api\controller\v1;

use app\api\model\Banner as BannerModel;
use app\api\validate\IDMustBePostiveInt;
use app\lib\exception\BannerMissException;

class Banner
{
   public function getBanner($id){
       (new IDMustBePostiveInt())->goCheck();
       $banner=BannerModel::getBannerId($id);
       if(!$banner){
           throw new BannerMissException();
       }
       return $banner;
   }
}